// ZakharovFunction.h: interface for the ZakharovFunction class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(ZAKHAROV_FUNCTION_H)
#define ZAKHAROV_FUNCTION_H


#include "Function.h"



#include <iostream>
using namespace std;


#include "Time.h" // to check time of cal a set of calculated intensities
                 // relative to additional overhead of cal derivatives
                 // for the purpose of first publication of HMC


class ZakharovFunction : public Function  
{
public:
	ZakharovFunction(int i_NInput);
	virtual ~ZakharovFunction();

	double Value(double *Input);
  double Value(vector<double> &Input);
  double NormValue(double *Input);
  double NormValue(vector<double> &Input);

	void BuildDerivative(double *Input, double *Derivative);

  double distanceFromGlobalMinimum(double *solution);

	void print_sol(double *Input, double ChiSq, char name[]);
  void print_sol(char filename[]);

	
	void createRandomSol(double *TestInput)
	{
	  int m;

		for(m=1;m<=NInput;m++)	  
    {
		  TestInput[m] = (15.0*ran1()) - 5.0;
      //TestInput[m] = ran1();
    }
	}

  void customModifySol(double *TestInput, int i) {}

  void test_function();



private:
  void checkBoundary(vector<double> &Input);
  void checkBoundary(double *Input);

	//Position   *XDerivative;
  double *mArray;
  //double *mSinArray;
  //double *dDerivative;
  double *mDerivative;

	Time timer; // to measure time for first HMC publication
};

#endif // !defined(ZAKHAROV_FUNCTION_H)
